package com.gzhryc.shared_device.oem.code.config.dao.db;

import java.io.Serializable;
import java.util.Date;

import com.gzhryc.common.NumberTools;
import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.JoinField;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.base.ILogisticsCostConfig;
import com.gzhryc.shared_device.base.enums.ELogisticsAreaScope;

/**
 * 物流费用配置
 * @version 2022-01-28
 */
@Table(name = "config_logistics_cost")
public class LogisticsCostConfig implements Serializable,ILogisticsCostConfig {

    private static final long serialVersionUID = 1L;

    @Id(autoIncrement = 100)
    protected Long id;

    @Column(name = "company_id",notNull = true,note = "物流公司ID")
    protected String companyId;

    @Column(name = "area_scope", note = "区域范围，1:全国，2:省，3:市")
    protected Integer areaScope;

    @Column
    protected String country; // 国家

    @Column
    protected String province; // 省

    @Column(name = "area_code", length = 128, note = "地区ID，以逗号分隔")
    protected String areaCode;

    @Column(note = "物流费用，单元：分")
    protected Integer money;

    @Column(name = "free_min_money", note = "包邮的客单价，单元：分")
    protected Integer freeMinMoney;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    @JoinField(name = "name", fromField = "company_id", toTable = "config_logistics_company")
    protected String companyName;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public Integer getAreaScope() {
        return areaScope;
    }

    public void setAreaScope(Integer areaScope) {
        this.areaScope = areaScope;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public Integer getFreeMinMoney() {
        return freeMinMoney;
    }

    public void setFreeMinMoney(Integer freeMinMoney) {
        this.freeMinMoney = freeMinMoney;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getAreaScopeName() {
        return ELogisticsAreaScope.note(this.areaScope);
    }

    public String getMoneyStr() {
        return NumberTools.getMoneyStr(this.money);
    }

    public String getFreeMinMoneyStr() {
        return NumberTools.getMoneyStr(this.freeMinMoney);
    }
}
